<?php

namespace WenRuns\Laravel\Admin\Form\Field\Grid\Field;

use WenRuns\Laravel\Admin\Form\Field\Grid\Column;

class DateTime extends Column
{
    protected $type = 'datetime';


    protected function initialization()
    {
        $this->configs([
            'options' => [
                'format' => 'YYYY-MM-DD HH:mm:ss',
                'locale' => 'zh-CN',
                'allowInputToggle' => true,
            ]
        ]);
        return parent::initialization(); // TODO: Change the autogenerated stub
    }


    public function options($options)
    {
        $this->configs['options'] = array_merge($this->configs['options'], $options);
        return $this;
    }

    public function option($name, $value)
    {
        $this->configs['options'][$name] = $value;
        return $this;
    }

    public function format($format)
    {
        return $this->option('format', $format);
    }

}
